subroutine initCharacteristics(a,i,i_vertex2D,i_nVer2D,i_nInCat2D,i_points,&
    i_numbersEl,i_params,i_edges,i_nodesforedges,i_vertex3D,i_nVer3D,i_igT,&
    i_jgT,i_ggT,i_MN)
    dimension a(100000000),i(100000000)
    real*8 a,eps2d,eps3d,eps3dNS,radiusRED,maxR,maxZ
    integer rz_dat,tsize_dat,gg_dat,elemsCount2D,typeTask,typeTask_txt,&
    points_txt,sigma_txt,t_size_dat,tsize3d_dat,xyz_dat,edges_dat,gg3dv_dat
    integer elemsCount3D,edgesCount3D,edgesTermCount3D,edgesNotTermCount3D
    common /files_characteristics/inf2tr_dat,nvkat2d_dat,rz_dat,nvtr_dat,tsize_dat,&
    points_txt,sigma_txt,inftry_dat,t_size_dat,tsize3d_dat,xyz_dat,nver_dat,&
    nodesforedges_dat,edges_dat,ig3dv_dat,jg3dv_dat,gg3dv_dat,MN_txt
    common /commonInfo/ eps2d,eps3d,eps3dNS,radiusRED,maxiter,typeTask,nt,nMaterials
    common /commonIndex/ indexI,indexA
    common /characteristics/ nPoints,nMn
    common /dimTask2D/nodesCount2D,elemsCount2D,nodesBoundCount2D,nodesTermCount2D,&
    m2D,mTerm2d,nodesNotTermCount2D,nMaterials2d
    common /dimTask3D/nodesCount3D,elemsCount3D,edgesCount3D,edgesTermCount3D,&
    edgesNotTermCount3D,mTerm3d
    common /files_common/infite_0,num_slae,log_txt,typeTask_txt

    call open_files_characteristics()

    !input 2D data
101 format(' ISLAU=',i8,' INDKU1=',i8,' INDFPO=',i8)
102 format('KUZLOV=',i8,'    KPAR=',i8,'    KT1=',i8,'    KT2=',i8,'    KT3=',i8)
103 format('KISRS1=',i8,' KISRS2=',i8,' KISRS3=',i8,'   KBRS=',i8)
104 format('KREB4 =',i8,' KTSIM =',i8)
    read(inf2tr_dat,101)k,k,k
    read(inf2tr_dat,102) nodesCount2D,elemsCount2D,nodesBoundCount2D,k1,k2
    read(inf2tr_dat,103) k,k,k,k
    read(inf2tr_dat,104) kreb4,k
    read(tsize_dat,*)nodesTermCount2D
    nodesNotTermCount2D = nodesCount2D-nodesTermCount2D
    read(points_txt,*)nPoints
    read(MN_txt,*)nMN

    i_params        = indexA
    call inputParams_task2d(a(i_params),sigma_txt,nMaterials2d)
    i_vertex2D      = i_params+nMaterials2d
    i_points        = i_vertex2D+2*nodesCount2D
    i_MN            = i_points+3*nPoints
    i_nVer2D        = indexI
    i_nInCat2D      = i_nVer2D+4*elemsCount2D
    i_numbersEl     = i_nInCat2D+elemsCount2D

    !input 3D data
105 format(' ISLAU=',i8,' INDKU1=',i8,' INDFPO=',i8)
106 format('KUZLOV=',i8,'    KPAR=',i8,'    KT1=',i8)
    read(inftry_dat,101)k,k,k
    read(inftry_dat,102) nodesCount3D,elemsCount3D,k
    read(t_size_dat,*)edgesTermCount3D
    read(t_size_dat,*)edgesNotTermCount3D
    read(t_size_dat,*)edgesCount3D

    i_edges         = i_numbersEl+4*nodesCount2D
    i_nodesforedges = i_edges+12*elemsCount3D
    i_nVer3D        = i_nodesforedges+3*edgesCount3D
    i_igT           = i_nVer3D+14*elemsCount3D
    i_jgT           = i_igT+edgesCount3D+1
    i_vertex3D      = i_MN+6*nMN
    i_ggT           = i_vertex3D+3*nodesCount3D
    call inputForCharacteristics(a(i_vertex2D),i(i_nVer2D),i(i_nInCat2D),&
    a(i_points),i(i_numbersEl),i(i_edges),i(i_nodesforedges),a(i_vertex3D),&
    i(i_nVer3D),i(i_igT),i(i_jgT),a(i_ggT),a(i_MN))

    call close_files_characteristics()

1   format(A,i8,' nElement =',i8)
    write(*,1)'SP: characteristics_normal(2d):   nVertex =',nodesCount2D,elemsCount2D
    write(*,1)'SP: characteristics_anomal(3d):   nVertex =',nodesCount3D,elemsCount3D
    write(log_txt,1)'SP: characteristics_normal(2d):   nVertex =',nodesCount2D,elemsCount2D
    write(log_txt,1)'SP: characteristics_anomal(3d):   nVertex =',nodesCount3D,elemsCount3D
end
!*************************************************************************
subroutine open_files_characteristics()
    common /files_characteristics/inf2tr_dat,nvkat2d_dat,rz_dat,nvtr_dat,&
    tsize_dat,points_txt,sigma_txt,inftry_dat,t_size_dat,tsize3d_dat,xyz_dat,&
    nver_dat,nodesforedges_dat,edges_dat,ig3dv_dat,jg3dv_dat,gg3dv_dat,MN_txt
    integer rz_dat,tsize_dat,points_txt,sigma_txt,t_size_dat,tsize3d_dat,&
    xyz_dat,edges_dat,gg3dv_dat,MN_txt

    inf2tr_dat        = 101
    nvkat2d_dat       = 102
    rz_dat            = 103
    nvtr_dat          = 104
    tsize_dat         = 105
    sigma_txt         = 106
    open(inf2tr_dat,file='.\calculations\mesh2dHfi\inf2tr.dat',mode='read')
    open(nvkat2d_dat,file='.\calculations\mesh2dHfi\nvkat2d.dat',access='direct',recl=4,mode='read')
    open(rz_dat,file='.\calculations\mesh2dHfi\rz.dat',access='direct',recl=16,mode='read')
    open(nvtr_dat,file='.\calculations\mesh2dHfi\nvtr.dat',access='direct',recl=24,mode='read')
    open(tsize_dat,file='.\calculations\mesh2dHfi\tsize.dat',mode='read')
    open(sigma_txt,file='.\calculations\mesh2dHfi\sigma',mode='read')

    points_txt        = 201
    MN_txt            = 202
    open(points_txt,file='.\calculations\points.txt',mode='read')
    open(MN_txt,file='.\calculations\MN.txt',mode='read')

    inftry_dat        = 301
    t_size_dat        = 302
    tsize3d_dat       = 303
    xyz_dat           = 304
    nver_dat          = 305
    nodesforedges_dat = 306
    edges_dat         = 307
    ig3dv_dat         = 308
    jg3dv_dat         = 309
    gg3dv_dat         = 310
    open(inftry_dat,file='.\calculations\mesh3d\inftry.dat',mode='read')
    open(t_size_dat,file='.\calculations\mesh3d\t_size.dat',mode='read')
    open(tsize3d_dat,file='.\calculations\mesh3d\tsize3d.dat',mode='read')
    open(xyz_dat,file='.\calculations\mesh3d\xyz.dat',access='direct',recl=24,mode='read')
    open(nver_dat,file='.\calculations\mesh3d\nver.dat',access='direct',recl=56,mode='read')
    open(nodesforedges_dat,file='.\calculations\mesh3dv\nodesforedges.dat',access='direct',recl=8,mode='read')
    open(edges_dat,file='.\calculations\mesh3dv\edges.dat',access='direct',recl=100,mode='read')
    open(ig3dv_dat,file='.\calculations\mesh3dv\ig3dv.dat',access='direct',recl=4,mode='read')
    open(jg3dv_dat,file='.\calculations\mesh3dv\jg3dv.dat',access='direct',recl=4,mode='read')
    open(gg3dv_dat,file='.\calculations\mesh3dv\gg3dv.dat',access='direct',recl=8,mode='read')
end
!*************************************************************************
subroutine inputForCharacteristics(vertex,nVer,nInCat2D,points,numbersEl,edges,&
    nodesforedges,vertex3D,nVer3D,igT,jgT,ggT,MN)
    common /files_characteristics/inf2tr_dat,nvkat2d_dat,rz_dat,nvtr_dat,tsize_dat,&
    points_txt,sigma_txt,inftry_dat,t_size_dat,tsize3d_dat,xyz_dat,nver_dat,&
    nodesforedges_dat,edges_dat,ig3dv_dat,jg3dv_dat,gg3dv_dat,MN_txt
    common /dimTask2D/nodesCount2D,elemsCount2D,nodesBoundCount2D,nodesTermCount2D,&
    m2D,mTerm2d,nodesNotTermCount2D,nMaterials2d
    common /boundaryTask2D/maxR,maxZ,minR,minZ
    common /characteristics/ nPoints,nMN
    common /dimTask3D/nodesCount3D,elemsCount3D,edgesCount3D,edgesTermCount3D,&
    edgesNotTermCount3D,mTerm3d
    integer rz_dat,tsize_dat,points_txt,sigma_txt,t_size_dat,tsize3d_dat,xyz_dat,&
    edges_dat,gg3dv_dat
    integer elemsCount2D,edges,elemsCount3D,edgesCount3D,edgesTermCount3D,&
    edgesNotTermCount3D
    real*8 vertex,ggT,points,maxR,maxZ,minR,minZ,vertex3D,MN
    dimension vertex(2,nodesCount2D),nVer(4,elemsCount2D),nInCat2D(elemsCount2D),&
    points(3,nPoints),numbersEl(4,nodesCount2D),edges(12,elemsCount3D),&
    nodesforedges(3,edgesCount3D),vertex3D(3,nodesCount3D),nVer3D(14,elemsCount3D),&
    igT(edgesTermCount3D+1),jgT(*),ggT(*),l1(1),MN(6,nMN)

    call readMesh2D(rz_dat,nvkat2D_dat,nvtr_dat,0,vertex,nInCat2D,nVer,l1,&
    nodesCount2D,elemsCount2D,0,minR,maxR,minZ,maxZ)
    call readMatrixT(ig3dv_dat,jg3dv_dat,gg3dv_dat,igT,jgT,ggT,edgesTermCount3D,mTerm3d)
    call readPoints(points_txt,points,nPoints)
    call readMN(MN_txt,MN,nMN)
    call getNumbersElementForVertex2D(nVer,numbersEl,elemsCount2D,nodesCount2D)

    call readVertex(xyz_dat,vertex3D,nodesCount3D,3)
    do j=1,elemsCount3D
        read(edges_dat,rec=j) edges(1,j),edges(2,j),edges(3,j),edges(4,j),&
                              edges(5,j),edges(7,j),edges(6,j),edges(8,j),&
                              edges(9,j),edges(10,j),edges(11,j),edges(12,j),&
                              k,k,k,k,k,k,k,k,k,k,k,k,k
        read(nver_dat,rec=j)(nVer3D(k,j),k=1,14)
        do k=1,12
            nodesforedges(3,edges(k,j))=j
        enddo
    enddo

    do j=1,edgesCount3D
        read(nodesforedges_dat,rec=j) nodesforedges(1,j),nodesforedges(2,j)
    enddo
end
!*************************************************************************
subroutine close_files_characteristics()
    common /files_characteristics/inf2tr_dat,nvkat2d_dat,rz_dat,nvtr_dat,&
    tsize_dat,points_txt,sigma_txt,inftry_dat,t_size_dat,tsize3d_dat,xyz_dat,&
    nver_dat,nodesforedges_dat,edges_dat,ig3dv_dat,jg3dv_dat,gg3dv_dat,MN_txt
    integer rz_dat,tsize_dat,points_txt,sigma_txt,t_size_dat,tsize3d_dat,xyz_dat,&
    edges_dat,gg3dv_dat,MN_txt

    close(inf2tr_dat)
    close(nvkat2d_dat)
    close(rz_dat)
    close(nvtr_dat)
    close(tsize_dat)
    close(points_txt)
    close(sigma_txt)
    close(inftry_dat)
    close(t_size_dat)
    close(tsize3d_dat)
    close(xyz_dat)
    close(nver_dat)
    close(nodesforedges_dat)
    close(edges_dat)
    close(MN_txt)
end
!*************************************************************************
!*************************************************************************
!*************************************************************************